import request from '@/utils/request'

// 创建资源库文件
export function createResFile(data) {
  return request({
    url: '/biz/res-file/create',
    method: 'post',
    data: data
  })
}

// 更新资源库文件
export function updateResFile(data) {
  return request({
    url: '/biz/res-file/update',
    method: 'put',
    data: data
  })
}

// 删除资源库文件
export function deleteResFile(id) {
  return request({
    url: '/biz/res-file/delete?id=' + id,
    method: 'delete'
  })
}

// 获得资源库文件
export function getResFile(id) {
  return request({
    url: '/biz/res-file/get?id=' + id,
    method: 'get'
  })
}

// 获得资源库文件分页
export function getResFilePage(query) {
  return request({
    url: '/biz/res-file/page',
    method: 'get',
    params: query
  })
}

// 导出资源库文件 Excel
export function exportResFileExcel(query) {
  return request({
    url: '/biz/res-file/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
